﻿using System;
using SCG.General;

namespace SCG.SolarVengeanceEngine.BrainInfo
{
    //UDOInfo class that Brains use to access UDOs
    public class UDOInfo
    {
        //constructor
        public UDOInfo(UDO udo)
        {
            _udo = udo;
        }

        //The UDO's location
        public SCGPoint Location
        {
            get
            {
                return _udo.Location;
            }
        }
        public int X
        {
            get
            {
                return (int)Location.X;
            }
        }
        public int Y
        {
            get
            {
                return (int)Location.Y;
            }
        }

        //The StarShip carrying this UDO
        public StarShipInfo Carrier
        {
            get
            {
                if (_udo.Carrier == null)
                    return null;
                else if (_udo.Carrier.VisibleTo[Brain.ThisPlayer])
                    return _udo.Carrier.Info;
                else
                    return null;             
            }
        }

        //private members
        private UDO _udo;
    }
}
